<?php
# This is the right menu.
# The list with the product categories is now showed

//Objetos y funciones de las categorías
 require_once('includes/classes/category.php');

#We load the root categories
$my_catalog=new category();
//$my_catalog->language_id=$server->my_site[0]->languages[0]->id;
//$my_catalog->site_id=$server->my_site[0]->id;
$my_catalog->db_load_subcategories();
$serCategories=json_encode($my_catalog);
# Se saca la categoría y se dejan las subcategorías
  //$category=array_shift($mis_categorias);
?>

                    <table class="leftcolumn">
                        <tr>
                            <td>
                                <table class="width">
                                    <tr>
                                        <td class="leftshadow">
                                        </td>
                                        <td class="maincontent">
                                            <table class="box">
                                                <tr>
                                                    <th>
							<a myFor="rightContentBox" title="Gama completa de productos">Tienda</a>
                                                    </th>
                                                </tr>
				<?php
				//This part is for printing the categories for bots that can't implement javascript
				if (isset($_SERVER['HTTP_USER_AGENT']) && $server->bot_detect($_SERVER['HTTP_USER_AGENT'])) {
					foreach ($my_catalog->categories as $category) {
						include($server->get_path_name("category.php"));
					}
				}
				?>
                                                <tr>
                                                    <td class="content">
                                                        <table class="boxInside">
                                                            <tr>
                                                                <td class="rowborder">
                                                                </td>
                                                            </tr>
								<tr>
									<td>
									<div id="categories">	
										<?php include($server->get_path_name("category_tp.php")); ?>
									</div>
									</td>
								</tr>
                                                            <tr>
                                                                <td class="rowborder">
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>                                  
                                            </table>
					   <div class="space">
					   </div>

                                            <table class="box">
                                                <tr>
                                                    <th>
							<a myFor="rightContentBox" href="?section=shop&category_id=26" title="Productos destacados">Destacados</a>
                                                    </th>
                                                </tr>
                                                <tr>
                                                    <td class="content">
                                                        <table class="boxInside">
                                                            <tr>
                                                                <td class="rowborder">
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="row">
									<a myFor="rightContentBox" href="?section=shop&category_id=26&current_subcategory_id=24" title="Productos populares">Populares</a>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="separator"><table class="separatorInside"><tr><td></td></tr></table></td>                                
                                                            </tr>
                                                            <tr>
                                                                <td class="row">
									<a myFor="rightContentBox" href="?section=shop&category_id=26&current_subcategory_id=25" title="Productos nuevos">Nuevos</a>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="rowborder">
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                            </table>
					    
					   <div class="space">
					   </div>
					    
                                            <table class="links">
                                                <tr>
                                                    <td>
							<a href="catalogo2008-1.pdf" title="Catálogo en pdf" target="_blank">Catálogo en pdf</a>
                                                    </td>
                                                </tr>
                                            </table>
                                            
                                        </td>
                                        <td class="rightshadow">
                                        </td>
                                    </tr>
                                    <tr>
                                    <td class="bottomleft">
                                    </td>
                                    <td class="bottomcenter">
                                    </td>
                                    <td class="bottomright">
                                    </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
<script type="text/javascript">
	var myCatalog=new orderCatalogNode();
	myCatalog.loadCategories('<?php echo $serCategories; ?>');
	myCatalog.loadCategoriesListView("categories");
	myCatalog.refreshCategoriesListView("categories");
</script>